package com.lagou.testFastjson;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor   //带参构造
@NoArgsConstructor  // 无参构造
public class Person {

    //通过name指定转换后的键名称
    @JSONField(name="USERNAME",ordinal = 1 )
    private String username;

    @JSONField(name="AGE" ,ordinal = 3)
    private int age;

    @JSONField(name="BIRTHDAY" ,ordinal = 2,serialize = false)
    private  String birthday;

}
